<?php
/**
 * 产品评论后台管理栏目新增文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	comments
 */
require_once('../config/config.inc.php');
require_once("../class/comments.class.php");
require_once("../block/user.php");
require_once ('../../useradmin/checklogin.php');

$intcommentsuserID=$_SESSION['user_id'];

$objWebInit = new comments();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
//翻页参数
$objWebInit->arrGPage = $arrGPage;
//图片上传参数
$objWebInit->arrGPic = $arrGPic;
$objWebInit->db();


if (empty($_GET['page'])) {
			$intPage = 1 ;
		} else {
			$intPage = intval($_GET['page']);
		}
		$arrWhere = array();
		$arrLink = array();
		$arrWhere[] = "pass='1'";

		$intcommentsID = intval($_GET['id']);
		$arrcommentsTop = array();
		$arrcommentsTop = $objWebInit->getInfoList("where pass = 1 and user_id=$intcommentsuserID",' order by submit_date desc',($intPage-1)*$arrGPage['page_size'],$arrGPage['page_size']);
		
		$intRows = $arrcommentsTop['COUNT_ROWS'];
		unset($arrcommentsTop['COUNT_ROWS']);


		//静态url处理
		$strLink = '';
		if($arrGWeb['URL_static']){
			if (!empty($arrLink)) $strLink = str_replace('=','-',implode('-',$arrLink));
		}else{
			if (!empty($arrLink)) $strLink = implode('&',$arrLink);
		}

	//翻页跳转link
	$strPage= $objWebInit->makeInfoListPage($intRows,$strLink,$link_type=$arrGWeb['URL_static']);

//全站公用block
@include '../../_block.php';

// 输出到模板
$arrMOutput["smarty_assign"]['arrcommentsTop'] = $arrcommentsTop;
$arrMOutput["smarty_assign"]['commentsImg'] = $arrGPic['FileCallPath'];
$arrMOutput["smarty_assign"]['strPage'] = $strPage;
$arrMOutput["smarty_assign"]['FileListPicSize'] = $arrGPic['FileListPicSize'];
$arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['adminu_main_dir'].'comments.html';
$objWebInit->output($arrMOutput);
?>